{"ast":null,"code":"/* eslint-disable import/prefer-default-export, prefer-destructuring */\nimport { generate } from '@ant-design/colors';\nimport { TinyColor } from '@ctrl/tinycolor';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport { updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport warning from '../_util/warning';\nvar dynamicStyleMark = \"-ant-\".concat(Date.now(), \"-\").concat(Math.random());\nexport function getStyle(globalPrefixCls, theme) {\n  var variables = {};\n  var formatColor = function formatColor(color, updater) {\n    var clone = color.clone();\n    clone = (updater === null || updater === void 0 ? void 0 : updater(clone)) || clone;\n    return clone.toRgbString();\n  };\n  var fillColor = function fillColor(colorVal, type) {\n    var baseColor = new TinyColor(colorVal);\n    var colorPalettes = generate(baseColor.toRgbString());\n    variables[\"\".concat(type, \"-color\")] = formatColor(baseColor);\n    variables[\"\".concat(type, \"-color-disabled\")] = colorPalettes[1];\n    variables[\"\".concat(type, \"-color-hover\")] = colorPalettes[4];\n    variables[\"\".concat(type, \"-color-active\")] = colorPalettes[6];\n    variables[\"\".concat(type, \"-color-outline\")] = baseColor.clone().setAlpha(0.2).toRgbString();\n    variables[\"\".concat(type, \"-color-deprecated-bg\")] = colorPalettes[0];\n    variables[\"\".concat(type, \"-color-deprecated-border\")] = colorPalettes[2];\n  };\n  // ================ Primary Color ================\n  if (theme.primaryColor) {\n    fillColor(theme.primaryColor, 'primary');\n    var primaryColor = new TinyColor(theme.primaryColor);\n    var primaryColors = generate(primaryColor.toRgbString());\n    // Legacy - We should use semantic naming standard\n    primaryColors.forEach(function (color, index) {\n      variables[\"primary-\".concat(index + 1)] = color;\n    });\n    // Deprecated\n    variables['primary-color-deprecated-l-35'] = formatColor(primaryColor, function (c) {\n      return c.lighten(35);\n    });\n    variables['primary-color-deprecated-l-20'] = formatColor(primaryColor, function (c) {\n      return c.lighten(20);\n    });\n    variables['primary-color-deprecated-t-20'] = formatColor(primaryColor, function (c) {\n      return c.tint(20);\n    });\n    variables['primary-color-deprecated-t-50'] = formatColor(primaryColor, function (c) {\n      return c.tint(50);\n    });\n    variables['primary-color-deprecated-f-12'] = formatColor(primaryColor, function (c) {\n      return c.setAlpha(c.getAlpha() * 0.12);\n    });\n    var primaryActiveColor = new TinyColor(primaryColors[0]);\n    variables['primary-color-active-deprecated-f-30'] = formatColor(primaryActiveColor, function (c) {\n      return c.setAlpha(c.getAlpha() * 0.3);\n    });\n    variables['primary-color-active-deprecated-d-02'] = formatColor(primaryActiveColor, function (c) {\n      return c.darken(2);\n    });\n  }\n  // ================ Success Color ================\n  if (theme.successColor) {\n    fillColor(theme.successColor, 'success');\n  }\n  // ================ Warning Color ================\n  if (theme.warningColor) {\n    fillColor(theme.warningColor, 'warning');\n  }\n  // ================= Error Color =================\n  if (theme.errorColor) {\n    fillColor(theme.errorColor, 'error');\n  }\n  // ================= Info Color ==================\n  if (theme.infoColor) {\n    fillColor(theme.infoColor, 'info');\n  }\n  // Convert to css variables\n  var cssList = Object.keys(variables).map(function (key) {\n    return \"--\".concat(globalPrefixCls, \"-\").concat(key, \": \").concat(variables[key], \";\");\n  });\n  return \"\\n  :root {\\n    \".concat(cssList.join('\\n'), \"\\n  }\\n  \").trim();\n}\nexport function registerTheme(globalPrefixCls, theme) {\n  var style = getStyle(globalPrefixCls, theme);\n  if (canUseDom()) {\n    updateCSS(style, \"\".concat(dynamicStyleMark, \"-dynamic-theme\"));\n  } else {\n    process.env.NODE_ENV !== \"production\" ? warning(false, 'ConfigProvider', 'SSR do not support dynamic theme with css variables.') : void 0;\n  }\n}","map":{"version":3,"names":["generate","TinyColor","canUseDom","updateCSS","warning","dynamicStyleMark","Date","now","Math","random","getStyle","globalPrefixCls","theme","variables","formatColor","color","updater","clone","toRgbString","fillColor","colorVal","type","baseColor","colorPalettes","setAlpha","primaryColor","primaryColors","forEach","index","c","lighten","tint","getAlpha","primaryActiveColor","darken","successColor","warningColor","errorColor","infoColor","cssList","Object","keys","map","key","join","trim","registerTheme","style","process","env","NODE_ENV"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/config-provider/cssVariables.js"],"sourcesContent":["/* eslint-disable import/prefer-default-export, prefer-destructuring */\nimport { generate } from '@ant-design/colors';\nimport { TinyColor } from '@ctrl/tinycolor';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport { updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport warning from '../_util/warning';\nconst dynamicStyleMark = `-ant-${Date.now()}-${Math.random()}`;\nexport function getStyle(globalPrefixCls, theme) {\n  const variables = {};\n  const formatColor = (color, updater) => {\n    let clone = color.clone();\n    clone = (updater === null || updater === void 0 ? void 0 : updater(clone)) || clone;\n    return clone.toRgbString();\n  };\n  const fillColor = (colorVal, type) => {\n    const baseColor = new TinyColor(colorVal);\n    const colorPalettes = generate(baseColor.toRgbString());\n    variables[`${type}-color`] = formatColor(baseColor);\n    variables[`${type}-color-disabled`] = colorPalettes[1];\n    variables[`${type}-color-hover`] = colorPalettes[4];\n    variables[`${type}-color-active`] = colorPalettes[6];\n    variables[`${type}-color-outline`] = baseColor.clone().setAlpha(0.2).toRgbString();\n    variables[`${type}-color-deprecated-bg`] = colorPalettes[0];\n    variables[`${type}-color-deprecated-border`] = colorPalettes[2];\n  };\n  // ================ Primary Color ================\n  if (theme.primaryColor) {\n    fillColor(theme.primaryColor, 'primary');\n    const primaryColor = new TinyColor(theme.primaryColor);\n    const primaryColors = generate(primaryColor.toRgbString());\n    // Legacy - We should use semantic naming standard\n    primaryColors.forEach((color, index) => {\n      variables[`primary-${index + 1}`] = color;\n    });\n    // Deprecated\n    variables['primary-color-deprecated-l-35'] = formatColor(primaryColor, c => c.lighten(35));\n    variables['primary-color-deprecated-l-20'] = formatColor(primaryColor, c => c.lighten(20));\n    variables['primary-color-deprecated-t-20'] = formatColor(primaryColor, c => c.tint(20));\n    variables['primary-color-deprecated-t-50'] = formatColor(primaryColor, c => c.tint(50));\n    variables['primary-color-deprecated-f-12'] = formatColor(primaryColor, c => c.setAlpha(c.getAlpha() * 0.12));\n    const primaryActiveColor = new TinyColor(primaryColors[0]);\n    variables['primary-color-active-deprecated-f-30'] = formatColor(primaryActiveColor, c => c.setAlpha(c.getAlpha() * 0.3));\n    variables['primary-color-active-deprecated-d-02'] = formatColor(primaryActiveColor, c => c.darken(2));\n  }\n  // ================ Success Color ================\n  if (theme.successColor) {\n    fillColor(theme.successColor, 'success');\n  }\n  // ================ Warning Color ================\n  if (theme.warningColor) {\n    fillColor(theme.warningColor, 'warning');\n  }\n  // ================= Error Color =================\n  if (theme.errorColor) {\n    fillColor(theme.errorColor, 'error');\n  }\n  // ================= Info Color ==================\n  if (theme.infoColor) {\n    fillColor(theme.infoColor, 'info');\n  }\n  // Convert to css variables\n  const cssList = Object.keys(variables).map(key => `--${globalPrefixCls}-${key}: ${variables[key]};`);\n  return `\n  :root {\n    ${cssList.join('\\n')}\n  }\n  `.trim();\n}\nexport function registerTheme(globalPrefixCls, theme) {\n  const style = getStyle(globalPrefixCls, theme);\n  if (canUseDom()) {\n    updateCSS(style, `${dynamicStyleMark}-dynamic-theme`);\n  } else {\n    process.env.NODE_ENV !== \"production\" ? warning(false, 'ConfigProvider', 'SSR do not support dynamic theme with css variables.') : void 0;\n  }\n}"],"mappings":"AAAA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,OAAOC,SAAS,MAAM,0BAA0B;AAChD,SAASC,SAAS,QAAQ,2BAA2B;AACrD,OAAOC,OAAO,MAAM,kBAAkB;AACtC,IAAMC,gBAAgB,kBAAWC,IAAI,CAACC,GAAG,EAAE,cAAIC,IAAI,CAACC,MAAM,EAAE,CAAE;AAC9D,OAAO,SAASC,QAAQ,CAACC,eAAe,EAAEC,KAAK,EAAE;EAC/C,IAAMC,SAAS,GAAG,CAAC,CAAC;EACpB,IAAMC,WAAW,GAAG,SAAdA,WAAW,CAAIC,KAAK,EAAEC,OAAO,EAAK;IACtC,IAAIC,KAAK,GAAGF,KAA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